package org.itboys.mobile.entity.mongo;


import org.itboys.commons.utils.time.TimeUtils;
import org.itboys.mobile.entity.ZhongBaoTag;
import org.itboys.mongodb.entity.BaseMongoEntity;
import org.mongodb.morphia.annotations.Entity;

import java.util.Date;

/**
 * 作者：jiangxiong
 * 日期：2017年4月26日
 * 联系方式 ：empty90911@126.com
 * 描述：圣代_移动端（通用）_用户_实体。如果属性不够，请自行填充
 */
@Entity(value="SundayMember", noClassnameStored=true)
public class SundayMember extends BaseMongoEntity {




    //基础属性
    private String userName;//登陆账号。随机生成
    private String nickName;//昵称
    private String image;//头像
    private String mobile;//手机号。用户注册标识
    private String mobileName;//联系电话
    private String email;//电子邮箱
    private Integer userType;//用户类型。根据项目逻辑自行定义。1，普通会员，2，个人版，3，商家版（含员工）
    private String idCard;//身份证号
    private String desc;//个人简介
    private String address;//地址
  //  private int status;//0正常，1冻结，2未注册(默认)，3待续费，废弃
    private int status;//0欠费或冻结，1正常（默认）
    //密钥信息
    private String password;//密码。md5加密
    private String weixinUnionId;//微信unionId
    private String weixinOpenId;//微信openId
    //地址信息
    private Long provinceId;//省ID
    private String provinceName;//省名称
    private Long cityId;//市Id
    private String cityName;//市名称
    private Long districtId;//区ID
    private String districtName;//区名称

    //其他信息
    private  Long parentId ;//父级账户ID
    private String career;//职称
    private String trade;//行业
    private String company;//公司名称
    private String keyword;//关键字
    private Long recommenderId;//推荐人ID

    //2017年11月17日
    private ZhongBaoTag tag;
    private Integer isSubscribe;
    //2018年1月15日
    private Long deadTime;//到期时间
    //private
  //  private Integer version;//版本1，试用版本，2，商业版本。针对商户

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public String getImage() {
        return image;
    }

    public void setImage(String image) {
        this.image = image;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getMobileName() {
        return mobileName;
    }

    public void setMobileName(String mobileName) {
        this.mobileName = mobileName;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public Integer getUserType() {
        return userType;
    }

    public void setUserType(Integer userType) {
        this.userType = userType;
    }

    public String getIdCard() {
        return idCard;
    }

    public void setIdCard(String idCard) {
        this.idCard = idCard;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getWeixinUnionId() {
        return weixinUnionId;
    }

    public void setWeixinUnionId(String weixinUnionId) {
        this.weixinUnionId = weixinUnionId;
    }

    public String getWeixinOpenId() {
        return weixinOpenId;
    }

    public void setWeixinOpenId(String weixinOpenId) {
        this.weixinOpenId = weixinOpenId;
    }

    public Long getProvinceId() {
        return provinceId;
    }

    public void setProvinceId(Long provinceId) {
        this.provinceId = provinceId;
    }

    public String getProvinceName() {
        return provinceName;
    }

    public void setProvinceName(String provinceName) {
        this.provinceName = provinceName;
    }

    public Long getCityId() {
        return cityId;
    }

    public void setCityId(Long cityId) {
        this.cityId = cityId;
    }

    public String getCityName() {
        return cityName;
    }

    public void setCityName(String cityName) {
        this.cityName = cityName;
    }

    public Long getDistrictId() {
        return districtId;
    }

    public void setDistrictId(Long districtId) {
        this.districtId = districtId;
    }

    public String getDistrictName() {
        return districtName;
    }

    public void setDistrictName(String districtName) {
        this.districtName = districtName;
    }

    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    public String getCareer() {
        return career;
    }

    public void setCareer(String career) {
        this.career = career;
    }

    public String getTrade() {
        return trade;
    }

    public void setTrade(String trade) {
        this.trade = trade;
    }

    public String getCompany() {
        return company;
    }

    public void setCompany(String company) {
        this.company = company;
    }

    public String getKeyword() {
        return keyword;
    }

    public void setKeyword(String keyword) {
        this.keyword = keyword;
    }

    public Long getRecommenderId() {
        return recommenderId;
    }

    public void setRecommenderId(Long recommenderId) {
        this.recommenderId = recommenderId;
    }

    public ZhongBaoTag getTag() {
        return tag;
    }

    public void setTag(ZhongBaoTag tag) {
        this.tag = tag;
    }

    public Long getDeadTime() {
        return deadTime;
    }

    public void setDeadTime(Long deadTime) {
        this.deadTime = deadTime;
    }

    /**
     * 状态的中文信息
     */
    public String  getStatusStr(){
        String statusStr= "";
        //if(status==null)return statusStr;

        switch (status) {
            case 0:
                statusStr="正常";
                break;
            case 1:
                statusStr="冻结";
                break;
            case 2:
                statusStr="未实名";
                break;
            case 3:
                statusStr="待续费";
                break;
            default:
                break;
        }
        return statusStr;
    }
    public String  getUserTypeStr(){
        String userTypeStr= "";

        switch (status) {
            case 1:
                userTypeStr="会员";
                break;
            case 2:
                userTypeStr="个人用户";
                break;
            case 3:
                userTypeStr="企业用户";
                break;
            default:
                break;
        }
        return userTypeStr;
    }

    public Integer getIsSubscribe() {
        return isSubscribe;
    }

    public void setIsSubscribe(Integer isSubscribe) {
        this.isSubscribe = isSubscribe;
    }

    public String  getDeadTimeStr(){
        String deadTimeStr="免费使用";
        if(deadTime!=null){
            deadTimeStr = TimeUtils.formatToTime(new Date(deadTime));
        }
        return  deadTimeStr;
    }
    /*public Integer getVersion() {
        return version;
    }

    public void setVersion(Integer version) {
        this.version = version;
    }*/
}
